package com.linzm.behavioraltype.observer07.observer;

import com.linzm.behavioraltype.observer07.Subject;

/**
 * @Author zimingl
 * @Date 2023/4/16 13:16
 * @Description: BinaryObserver
 */
public class BinaryObserver extends Observer {
    public BinaryObserver(Subject subject) {
        this.subject = subject;
        this.subject.attach(this);
    }

    @Override
    public void update() {
        System.out.println("Binary String: "
                + Integer.toBinaryString(subject.getState()));
    }
}
